home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11999 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.4 KB  |  54 lines

  1. Path: solaris.cc.vt.edu!usenet
  2. From: Salah Almajdoub <salah@whistle.ee.vt.edu>
  3. Newsgroups: comp.lang.c++
  4. Subject: an STL vector of emun inside a class, BC++ 4.52
  5. Date: Mon, 18 Mar 1996 12:36:42 -0500
  6. Organization: Electrical Engineering, Virginia Tech
  7. Message-ID: <314D9F2A.4BC8@whistle.ee.vt.edu>
  8. NNTP-Posting-Host: dobro.ee.vt.edu
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
  13.  
  14. Hi every body
  15.  
  16. I've got a class "TNode" that includes an enumeration
  17. "TColor" and an STL vector of TCOLOR. BORLAND C++ 4.52
  18. won't accept it because it needs a destructor
  19. for the enum when it calls the template function 
  20. "destroy" of STL. I tried to override the 
  21. destroy funtion but BC++ won't consider it,
  22. BC++ would always consider the template version of destroy
  23. in STL and ignores mine, producing an error message.
  24.  
  25. my code looks somthing like this
  26.  
  27. class TNode {
  28.     public:
  29.     // enumeration is defined inside the class
  30.     enum TColor {white, black, red, ... }; 
  31.  
  32.  
  33.     TNode();
  34.  
  35.     protected:
  36.     char * name;
  37.  
  38.     // a vector of enumeration inside the class
  39.     vector<TColor> Color_List;
  40. }    
  41.  
  42. I tried to add the following function after the above code
  43.  
  44. inline void destroy(TNode::TColor *) {}
  45.  
  46. but BC++ won't accept it, yet it works
  47. on IBM C Set++ under AIX (only after destroy is overriden)
  48.  
  49. any idea on how to make borland override the destroy 
  50. function for this case?
  51.  
  52. -- salah almajdoub
  53. sam@whistle.ee.vt.edu
  54.